﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="product_detail.aspx.cs" Inherits="E1_eMart.WebForm2"%>

<asp:Content ID="Content1" ContentPlaceHolderID="MainBody" runat="server">
    <ul id="login">
       <%
        if (Session["username"] == null)
    {
    %>    
        <li><a href="register.aspx">Register</a></li>
        <li><a href="Login.aspx">Sign in</a></li>  
    <%}
    else
    {%>
    <li>Hello, 
    <%if (loaiTaiKhoan == 1)
      { %>
        <a href="user/Account_Management.aspx">
            <% =tk.TenTaiKhoan%> 
        </a>
        <%}
      else
      { %>
      <a href="">
            <% =tk.TenTaiKhoan%> 
        </a>
        <%} %>
    </li>
    <li>
        <asp:LinkButton ID="lbLogOut" runat="server" 
            onclientclick="if(!confirm('Bạn có muốn thoát không?'))return false" 
            PostBackUrl="~/Logout.aspx">Logout</asp:LinkButton>       
    <%}%>     
     </ul>
    <div id="product_image">
            <img src=<%= spham[0].Imglink%> width="120px" />
        </div>
        <div id="product_summary">
            <table>
                <tr>
                    <h3><%= spham[0].TenSanPham%></h3>
                </tr>
                <tr>
                    <h3>-------------------------</h3>
                </tr>
                <tr>
                    <th class="item_info">Item condition:</th>
                    <td><span class="">New</span></td>
                </tr>
                <tr>
                    <th class="item_info">Time left:</th>
                    <td><span class="">9d 04h (Mar 28, 201104:52:23 PDT)</span></td>
                </tr>
                <tr>
                    <th class="item_info">Price:</th>
                    <td><span style="font-size:large; color:Blue"><%= spham[0].GiaKhoiDiem%> $</span></td>
                </tr>
                <tr>
                    <th class="item_info">Highest Order:</th>
                    <td><span id="Highest_Order" style="font-size: large; color: #ff9933; font-style: oblique;"><% =spham[0].GiaHienTai%> $</span></td>
                </tr>
                <tr>
                    <th class="item_info"><label for="user_order">Your Order:</label></th>
                    <td>
                    <%if (loaiTaiKhoan == 1)
                      { %>
                        <input id="user_order" type="text" alt="your order" value=""/>
                        <span class="">
                            <a style="border:1px; solid darkgreen; background:green; color:White; display:inline-block; padding:3px 10px; border-radius: 6px;" href="#" onclick="BuyItNow(<%if(Request["id"]!=null)%> <%=Request["id"]%>)">Buy It Now</a>
                        </span>
                    <%}
                      else
                      {%>
                        <font color=red>Guest, Admin and Manager may not use the auction!</font>
                      <%} %>
                    </td>
                </tr>
                <tr>
                    <th class="item_info">Shipping:</th>
                    <td><span class="">Free</span> </td>
                </tr>
                <tr>
                    <th class="item_info">Delivery:</th>
                    <td><span class="">Varies</span> </td>
                </tr>
                <tr>
                    <th class="item_info">Returns:</th>
                    <td><span class="">7 day money back, buyer pays return shipping</span> </td>
                </tr>
            </table>
        </div>
        <div id="seller_info">
            <div id="s_content">
                <table class="sub_content">
                    <tr>
                        <td><h3>Seller Info</h3></td>
                    </tr>
                    <tr>
                        <td><a href="user_detail.aspx?mtk=<%= spham[0].TaiKhoan.MaTaiKhoan%>"><%= spham[0].TaiKhoan.TenTaiKhoan%></a></td>
                    </tr>
                    <tr class="left_hr">
                        <td><h4>99.5% Positive feedback</h4></td>
                    </tr>

                    <tr><td><a href="#">Save this seller</a></td></tr>
                    <tr><td><a href="#">See other items</a></td></tr>
                </table>
                <table class="sub_content">
                    <tr>
                        <td colspan="2"><h3>Other item Info</h3></td>
                    </tr>
                    <tr>
                        <th class="item_info">Item number:</th>
                        <td><span class=""><%= spham[0].MaSanPham%></span> </td>
                    </tr>
                    <tr>
                        <th class="item_info">Item location:</th>
                        <td><span class=""><%= nguoiDang[0].DiaChi%></span> </td>
                    </tr>
                    <tr>
                        <th class="item_info">Ships to:</th>
                        <td><span class="">United States</span> </td>
                    </tr>
                    <tr>
                        <th class="item_info">Payments:</th>
                        <td><span class="item_info">PayPal</span></td>
                    </tr>
                    <tr>
                        <th class="item_info">History:</th>
                        <td><a href="#">1 sold</a></td>
                    </tr>
                </table>
            </div>
            <table>

            </table>
        </div>

        <br/>
        <br/>    

        <div class="clear"></div>

        <h3>Item Description</h3>
        <div id="item_description" style="padding: 10px;">
            <% for(int index = 0; index < moTaSP.Count;index++)
               { %>
            <p><%= moTaSP[index]%></p>
            <%
               } %>
        </div>

        <div id="comment" style="margin-left: 200px;">
            <h5 style="margin-top: 50px;">Add your comment here!</h5><br />           
            <textarea id="commentContent" name="comment"  ROWS=10 COLS=50></textarea>
        </div>
        <p style="margin-left: 200px">
        <a href="#submit" name="Add"
        onclick="AddComment(<%if(Request["id"]!=null)%> <%=Request["id"]%>)" 
                style="margin-left: 0px">Click to add comment</a>            
        </p>
        <h5 id="nd" style="margin-top: 20px; margin-left: 200px;">All Comments</h5> 
        <div id="Div1" style="margin-top: 20px; margin-left: 5px;">
        <% for (int i = 0; i < comments.Count; i++)
                {           
                %>               
                <div id="ThongTinComment" style="margin-top: 20px; margin-left: 200px;">
                     <%= listTaiKhoanComment[i].TenTaiKhoan%> ( <%= comments[i].NgayComment%>):    <%=  comments[i].NoiDungComment%>           
                </div>                                       
                <%
                   } 
        %>  
        </div>  

        <div class="clear"></div>
</asp:Content>
